home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gchess40.lha / gnuchess4.0p62 / src / Makefile.ddj < prev    next >
Makefile  |  1993-06-22  |  13KB  |  368 lines

  1. #
  2. # Makefile for GNU Chess
  3. # (Use this makefile when compiling under DOS using DJGPP)
  4. #
  5. # Copyright (c) 1992 Free Software Foundation
  6. #
  7. # This file is part of GNU CHESS.
  8. #
  9. # GNU Chess is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2, or (at your option)
  12. # any later version.
  13. #
  14. # GNU Chess is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with GNU Chess; see the file COPYING.  If not, write to
  21. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  22. #
  23.  
  24. #
  25. # gnuchess  is a curses-based chess.
  26. # gnuchessn is a fancy-display-curses-based chess.
  27. # gnuchessr is a plain dumb-terminal chess (but with full variation output)
  28. # gnuchessc is suitable for chesstool use (mimics /usr/games/chess output)
  29. # gnuchessx is the xchess based chess.
  30. #
  31.  
  32. # The version number of this GNU and Xboard release
  33. VERS=    4.0
  34. XVERS = 2.0
  35.  
  36. # Relevant file areas.
  37. DIST=    ../README ../README.lang ../doc ../misc ../src ../test
  38.  
  39. # size of book to make
  40. # listed below are the book options and the size of the resulting book
  41. #
  42. # default is small
  43. # set BOOKTYPE to the book you want
  44. #
  45. #huge.book.data         1,450k
  46. #big.book.data            540k
  47. #med.book.data            240k
  48. #small.book.data      144K
  49. #tiny.book.data            78K
  50.  
  51. BOOKTYPE=huge.book.data
  52.  
  53. # Distribution directory
  54. DISTDIR= .
  55.  
  56. # Programs being distributed
  57. PROGS=gnuchess-$(VERS) xboard-$(XVERS)
  58. #PROGS=gnuchess-$(VERS)
  59.  
  60. # For -DGDBM option
  61. LIBS = -lm
  62.  
  63. # Change these to something less transitory, like /usr/games, and then
  64. # compile. Ask your system admin / unix guru to put gnuchess.{hash,lang,book}
  65. # in $(LIBDIR).
  66. # Where the binaries live.
  67. #BINDIR= /tmp_mnt/home/fsf/cracraft/Ch
  68. #BINDIR= /udir/mann/bin/alpha
  69. #BINDIR= /usr/local/bin
  70. BINDIR= /games/gnu40_62
  71. BINDIR1 = \games\gnu40_62
  72.  
  73. # Where language description, our book, and the persistent hash live.
  74. #LIBDIR= /usr/local/lib
  75. #LIBDIR= /udir/mann/lib/alpha
  76. LIBDIR= .
  77.  
  78. # Display routines.
  79. LCURSES=-lcurses -ltermcap
  80.  
  81. #compile options for gnuchess
  82. # -DQUIETBACKGROUND don't print post information in background ( easy OFF)
  83. # -DNOMEMSET if your machine does not support memset
  84. # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  85. # -DNODYNALPHA don't dynamically adjust alpha
  86. # -DHISTORY use history killer hueristic 
  87. # -DKILLT use killt killer hueristic 
  88. # -DHASGETTIMEOFDAY use gettimeofday for more accurate timing
  89. # -DOLDTIME use old ply time estimating function
  90. # -DCLIENT create client version for use with ICS
  91. # -DOLDXBOARD don't generate underpromote moves
  92. # -DGNU3 don't generate underpromote moves
  93. # -DLONG64 if you have 64bit longs
  94. # -DSYSV   if you are using SYSV
  95. # -DCACHE  Cache static evaluations 
  96. # -DE4OPENING always open e4 if white and respond to e4 with e5 if black
  97. # -DQUIETBOOKGEN Don't print errors while loading a book or generating a binbook
  98. # -DSEMIQUIETBOOKGEN Print less verbose errors while reading book or generating binbook
  99. # -DGDX  use random file based book
  100. # -DNULLMOVE include null move heuristic
  101. # some debug options
  102. # -DDEBUG8 dump board,movelist,input move to /tmp/DEBUG if illegal move
  103. # -DDEBUG9 dump move list from test command
  104. # -DDEBUG10 dump board and move after search before !easy begins
  105. # -DDEBUG11 dump board when the move is output
  106. # -DDEBUG12 dump boards between moves
  107. # -DDEBUG13 dump search control information for each move to /tmp/DEBUG
  108. # -DDEBUG33 dump book moves as read from book
  109. # -DDEBUG40 include extra values of variables for debugging  in game list
  110. # -DDEBUG41 dump post output to /tmp/DEBUG
  111. # the rest of the debug options are tied to the debuglevel command
  112. # -DDEBUG -DDEBUG4 set up code for debuglevel command
  113. #          debuglevel
  114. #               1 always force evaluation in evaluate
  115. #               4 print move list after search
  116. #               8 print move list after book before search
  117. #              16 print move list after each ply of search
  118. #              32 print adds to transposition table
  119. #              64 print returns from transposition table lookups
  120. #          256 print search tree as it is generated
  121. #          512 debug trace
  122. #         1024 interactive tree print
  123. #            debug? p#  where # is no. of plys to print from top of tree (default all plys)
  124. #                   XXXX moves specifying branch of tree to print (default all branches)
  125. #                   return terminates input
  126. #         2048 non-interactive trace print
  127. # gnufour ICS client
  128. #OPT= -DCACHE -DCLIENT -DGDX -DGNU3 -DHASGETTIMEOFDAY -DHISTORY -DNULLMOVE  -DQUIETBACKGROUND -DSEMIQUIETBOOKGEN
  129. # normal
  130. OPT= -DCACHE -DGDX -DHASGETTIMEOFDAY -DHISTORY -DNULLMOVE  -DOLDTIME -DQUIETBACKGROUND -DSEMIQUIETBOOKGEN
  131.  
  132. # The hashfile is a record of positions seen. It is used by
  133. # GNU Chess to avoid making the same mistakes, a form of learning.
  134. HASH=    -DHASHFILE=\"$(LIBDIR)/gnuchess.hash\"
  135.  
  136. # The "book" is a record of the first few moves, for playing good
  137. # moves easily and quickly, saving time, and irritating the human
  138. # opponent.
  139. #BOOK=    -DBOOK=\"$(LIBDIR)/gnuchess.book\"
  140. BOOK=    
  141. BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnuchess.dat\"
  142.  
  143. # The language file describes capabilities of the program. Perhaps
  144. # it is useful for non-English speaking countries and customizing
  145. # for their convenience and chess happiness.
  146. LANG= -DLANGFILE=\"$(LIBDIR)/gnuchess.lang\"
  147.  
  148. # The compiler used for compiling this software.
  149. # Use this for a plain C compiler 
  150. #CC= cc $(OPT)
  151. # Use this for DEC's ANSI C compiler on Ultrix
  152. #CC= c89 $(OPT)
  153. # Use this if you are lucky enough to have GNU CC.
  154. CC=     gcc -Wall $(OPT)
  155. #CC=    cc $(OPT) # HPUX
  156. #CC=    /contrib/system/bin/gcc -W $(OPT)
  157.  
  158. # Miscellaneous CFLAGS. Uncomment the one you need and comment 
  159. # the other.
  160. #CFLAGS=  -O2 -p -Dinline=""     -traditional-cpp
  161. #CFLAGS= -O4 -Qpath .  # SunOS cc using unprotoize
  162. #CFLAGS= -O4 # Sun acc
  163. #CFLAGS= -g -traditional-cpp  # debug
  164. #CFLAGS= -O2 # DEC ANSI C (c89) on Ultrix.
  165. #CFLAGS= +O3 -Aa -D_HPUX_SOURCE -DSYSV # HPUX cc 
  166. #CFLAGS= -O   -finline-functions -fstrength-reduce -D__mips -D__LANGUAGE_C # gnu cc 1.40 on DS5000
  167. #CFLAGS= -O   -finline-functions -fstrength-reduce  # gnu cc 1.40 on others
  168. #CFLAGS= -O2 -funroll-loops -D__mips -D__LANGUAGE_C # gnu cc 2.00 on DS5000
  169. #CFLAGS= -O2 -D__alpha -D__LANGUAGE_C # gnu cc 2.00 on Flamingo
  170. #CFLAGS= -O2 -funroll-loops -traditional-cpp  # gnu cc  2.00 on SunOS
  171. CFLAGS= -O2 -funroll-loops  # gnu cc  2.00 on others
  172.  
  173. all : gnuchess.exe gnuchesr.exe gnuchesn.exe postprint.exe gnuan.exe game.exe bincheckr.exe checkgame.exe checkbook.exe
  174.  
  175. gnuchess.exe: mainN.o bookN.o genmoveN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o uxdsp.o
  176.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchess mainN.o bookN.o genmoveN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o uxdsp.o $(LIBS)
  177.         $(CC) @tmp
  178.         strip gnuchess
  179.         aout2exe gnuchess
  180.         del gnuchess
  181.  
  182. gnuan.exe: mainN.o bookN.o genmoveN.o ataks.o util.o evalN.o init.o searchN.o gnuan.o
  183.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuan mainN.o bookN.o genmoveN.o ataks.o util.o evalN.o init.o searchN.o gnuan.o $(LIBS)
  184.         $(CC) @tmp
  185. #        strip gnuan
  186.         aout2exe gnuan
  187.         del gnuan
  188.  
  189. gnuchesr.exe: mainN.o bookN.o genmoveN.o ataks.o util.o evalN.o init.o searchN.o dspcomR.o nondspR.o
  190.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchesr mainN.o bookN.o genmoveN.o ataks.o util.o evalN.o init.o searchN.o dspcomR.o nondspR.o $(LIBS)
  191.         $(CC) @tmp
  192.         strip gnuchesr
  193.         aout2exe gnuchesr
  194.         del gnuchesr
  195.  
  196. gnuchesn.exe: mainN.o bookN.o genmoveN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o nuxdsp.o
  197.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchesn mainN.o bookN.o genmoveN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o nuxdsp.o $(LIBS)
  198.         $(CC) @tmp
  199.         strip gnuchesn
  200.         aout2exe gnuchesn
  201.         del gnuchesn
  202.  
  203. game.exe: game.c gnuchess.h
  204.         >tmp $(CFLAGS) -o game game.c
  205.         $(CC) @tmp
  206.         strip game
  207.         aout2exe game
  208.         del game
  209.     
  210. postprint.exe: postprint.o
  211.         >tmp $(CFLAGS) $(HASH) -o postprint postprint.o
  212.         $(CC) @tmp
  213.         strip postprint
  214.         aout2exe postprint
  215.         del postprint
  216.     
  217. bincheckr.exe: bincheckr.o
  218.         >tmp $(CFLAGS) -o bincheckr bincheckr.o
  219.         $(CC) @tmp
  220.         strip bincheckr
  221.         aout2exe bincheckr
  222.         del bincheckr
  223.     
  224. checkgame.exe: checkgame.o
  225.         >tmp $(CFLAGS) -o checkgame checkgame.o
  226.         $(CC) @tmp
  227.         strip checkgame
  228.         aout2exe checkgame
  229.         del checkgame
  230.  
  231. checkbook.exe: checkbook.o
  232.         >tmp $(CFLAGS) -o checkbook checkbook.o
  233.         $(CC) @tmp
  234.         strip checkbook
  235.         aout2exe checkbook
  236.         del checkbook
  237.  
  238. gnuan.o: gnuan.c gnuchess.h version.h
  239.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) -c gnuan.c
  240.         $(CC) @tmp
  241.  
  242. mainN.o: main.c gnuchess.h version.h
  243.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) -c main.c
  244.         $(CC) @tmp
  245.         del mainN.o
  246.         rename main.o mainN.o
  247.  
  248. genmoveN.o: genmove.c gnuchess.h version.h
  249.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c genmove.c
  250.         $(CC) @tmp
  251.         del genmoveN.o
  252.         rename genmove.o genmoveN.o
  253.  
  254. bookN.o: book.c gnuchess.h version.h ataks.h
  255.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) -c book.c
  256.         $(CC) @tmp
  257.         del bookN.o
  258.         rename book.o bookN.o
  259.  
  260. ataks.o: ataks.h ataks.c gnuchess.h version.h
  261.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c ataks.c
  262.         $(CC) @tmp
  263.  
  264. util.o: util.c gnuchess.h version.h
  265.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c util.c
  266.         $(CC) @tmp
  267.  
  268. evalN.o: eval.c gnuchess.h version.h
  269.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c eval.c
  270.         $(CC) @tmp
  271.         del evalN.o
  272.         rename eval.o evalN.o
  273.  
  274. init.o: init.c gnuchess.h version.h
  275.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c init.c
  276.         $(CC) @tmp
  277.  
  278. searchN.o: search.c gnuchess.h version.h debug512.h debug10.h debug13.h debug16.h debug256.h debug4.h debug40.h debug41.h debug64.h debug8.h
  279.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c search.c
  280.         $(CC) @tmp
  281.         del searchN.o
  282.         rename search.o searchN.o
  283.  
  284. uxdsp.o: uxdsp.c gnuchess.h version.h
  285.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c uxdsp.c
  286.         $(CC) @tmp
  287.  
  288. nuxdsp.o: nuxdsp.c gnuchess.h version.h
  289.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c nuxdsp.c
  290.         $(CC) @tmp
  291.  
  292. nondspR.o: nondsp.c gnuchess.h version.h
  293.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -c nondsp.c
  294.         $(CC) @tmp
  295.         del nondspR.o
  296.         rename nondsp.o nondspR.o
  297.  
  298. dspcomN.o: dspcom.c gnuchess.h version.h
  299.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c dspcom.c
  300.         $(CC) @tmp
  301.         del dspcomN.o
  302.         rename dspcom.o dspcomN.o
  303. dspcomR.o: dspcom.c gnuchess.h version.h
  304.         >tmp $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -c dspcom.c
  305.         $(CC) @tmp
  306.         del dspcomR.o
  307.         rename dspcom.o dspcomR.o
  308.  
  309. postprint.o: postprint.c gnuchess.h version.h
  310.         >tmp $(CFLAGS) $(HASH) -c postprint.c
  311.         $(CC) @tmp
  312.  
  313. huge.book.data:
  314.         del .\gnuchess.dat
  315.         gnuchesr -b .\gnuchess.bk1 -B ./gnuchess.dat -S 320000 -P 24
  316.         del \t
  317.  
  318. big.book.data:
  319.         del .\gnuchess.dat
  320.         gnuchesr -b .\gnuchess.bk1 -B ./gnuchess.dat -S 45000 -P 16
  321.         del \t
  322.  
  323. med.book.data:
  324.         del .\gnuchess.dat
  325.         gnuchesr -b .\gnuchess.bk1 -B ./gnuchess.dat -S 20000 -P 12
  326.         del \t
  327.  
  328. small.book.data:
  329.         del .\gnuchess.dat
  330.         gnuchesr -b .\gnuchess.bk1 -B ./gnuchess.dat -S 12000 -P 10
  331.         del \t
  332.  
  333. tiny.book.data:
  334.         del .\gnuchess.dat
  335.         gnuchesr -b .\gnuchess.bk1 -B ./gnuchess.dat -S 9000 -P 8
  336.         del \t
  337.  
  338.  
  339. distribution:
  340.     -patchlevel=`cat $(DISTDIR)/gnuchess-$(VERS)/src/version.h|grep patchlevel|sed -e 's/[^0-9]//g'` ;\
  341.     echo "GNU patchlevel is $$patchlevel" ;\
  342.     xpatchlevel=`cat $(DISTDIR)/xboard-$(XVERS)/patchlevel.h|sed -e "s/#define PATCHLEVEL //"` ;\
  343.     cd $(DISTDIR) ;\
  344.     rm -f gnuchess.tar.$(VERS).Z* gnuchess.tar.$(VERS).Z.uu* ;\
  345.     tar cf - $(PROGS) | compress > $(DISTDIR)/gnuchess-$(VERS).pl$$patchlevel.tar.Z ;\
  346.     uuencode gnuchess-$(VERS).pl$$patchlevel.tar.Z gnuchess-$(VERS).pl$$patchlevel.tar.Z > gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  347.     rm -f x?? ;\
  348.     split -2500 gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  349.     for i in x??; do \
  350.       mv $$i $(DISTDIR)/GNU_Chess_$$i; \
  351.     done
  352.  
  353. install: $(BOOKTYPE)
  354.         -copy gnuchesr.exe $(BINDIR1)\gnuchesr.exe
  355.         -copy gnuchesn.exe $(BINDIR1)\gnuchesn.exe
  356.         -copy postprin.exe $(BINDIR1)\postprin.exe
  357.         -copy gnuan.exe $(BINDIR1)\gnuan.exe
  358.         -copy gnuchess.exe $(BINDIR1)\gnuchess.exe
  359.         -copy bincheck.exe $(BINDIR1)\bincheck.exe
  360.         -copy checkgam.exe $(BINDIR1)\checkgam.exe
  361.         -copy checkboo.exe $(BINDIR1)\checkboo.exe
  362.         -copy game.exe $(BINDIR1)\game.exe
  363.  
  364. clean:
  365.         -del *.o
  366.         -del *.exe
  367.  
  368.